package com.itts.Factory;

import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.regex.Matcher;
import java.util.regex.Pattern;


public abstract class ValidatorMethod {
    private static final Logger log = LoggerFactory.getLogger(ValidatorMethod.class);

    private static Pattern PATTERN_NUMBER = Pattern.compile("^[0-9]+$");

    public ValidatorMethod(){}

    public boolean ismobile(String val) {
        return this.checkbyPattern(val,PATTERN_NUMBER);
    }
    private boolean checkbyPattern(String val, Pattern pattern){
        if (StringUtils.isNotEmpty(val)){
            Matcher matcher = pattern.matcher(val);
            return matcher.matches();
        }else {
            return false;
        }
    }







}
